/**
 * Copyright (C) 2013-2014 the original author or authors.
 */
package com.foreveross.bsl.mam.rbac.application;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.foreveross.bsl.common.utils.web.QuerySpecs;
import com.foreveross.bsl.mam.rbac.application.vo.UserVO;

/**
 * @description
 * 
 * @author rening
 * @version v1.0
 * 
 * @2013-6-7
 * 
 */
@Path(value = "/user")
@Produces({ MediaType.APPLICATION_JSON })
public interface UserApplication {
	@POST
	@Path("add")
	public UserVO saveEntity(UserVO entity);
 
	@PUT
	@Path("update")
	public UserVO updateEntity(UserVO entity);

	@DELETE
	@Path("delete/{id}")
	public void deleteEntity(@PathParam("id") String id);

	@GET
	@Path("get/{id}")
	public UserVO getEntity(@PathParam("id") String id);

	@GET
	@Path("find-all")
	public List<UserVO> findAll();

	@POST
	@Path("find-page")
	@Consumes({ MediaType.APPLICATION_JSON })
	public Page<UserVO> findByPageable(Pageable pageable);

	@GET
	@Path("get-by-name/{userName}")
	public UserVO getUserByUserName(@PathParam("userName") String username);

	@GET
	@Path("find/{page}/{size}")
	public Page<UserVO> findUsersBySpec(@PathParam("page") int pageNumber, @PathParam("size") int pageSize,
			@QueryParam("q") QuerySpecs querySpecs);

}
